.product-page {
  padding-bottom: 80px;

  .widget-radio-inline {
    div.radio {
      display: inline;
    }

    label {
      display: inline-block;
    }

    a.btn {
      display: inline;
      height: 29px;
    }
  }

  h2 {
    padding-top: 20px;
  }

  .widget-checkbox-inline {
    div.checkbox {
      display: inline;
    }
    label {
      display: inline;
    }
  }

  .table-fixed {
    table-layout: fixed;
    border: 0;
    thead {
      width: 90%;
      border: 0;
    }
    thead th {
      border: 0;
    }
    tbody {
      width: 100%;
      height: 130px;
      overflow-y: auto;
    }
    tbody td,
    thead > tr > th {
      border-bottom-width: 0;
    }
    tr {
      clear: both;
    }
    td {
      span {
        word-break: break-all;
        word-wrap: break-word;
      }
    }
  }

  &::before {
    position: fixed;
    top: $size-header-height - 0.0625rem;
    right: 0;
    left: 0;
    z-index: 400;
    display: block;
    height: 1px;
    content: "";
    box-shadow: $gray-dark 0 0 10px;
  }

  // Resets
  ul.nostyle {
    padding: 0;
    list-style: none;
  }
  .tab-content {
    padding: 0;

    .bordered {
      margin-top: -1px;
    }
  }

  // Components
  .product-header {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
    margin-top: -$grid-gutter-width / 2;
    margin-bottom: $grid-gutter-width / 2;
    background: #fff;
    .edit {
      background-size: 4%;
    }
    .help-box {
      margin-top: 0.625rem;
      margin-left: 0.625rem;
    }
    .form_step1_type_product,
    .form_switch_language,
    .toolbar {
      display: flex;
      align-items: center;
    }
  }

  .big-input {
    .form-control {
      font-size: 1.5rem;
    }
  }
  .bulk-action {
    cursor: pointer;
  }

  #bulk-combinations-container {
    width: 97%;
    padding: 0 0.9375rem;
    margin: -1.063rem 0 0.9375rem;
    font-size: 0.75rem;
    font-weight: 600;

    #bulk-combinations-container-fields > div {
      @extend .px-3;
      @extend .py-2;
    }
  }

  .product-footer {
    position: fixed;
    right: 0;
    bottom: 0;
    left: $size-navbar-width;
    z-index: 10;
    display: flex;
    align-items: center;
    background: #fff;
    box-shadow: $gray-dark 0 0 10px;
    padding: {
      top: $grid-gutter-width / 2;
      bottom: $grid-gutter-width / 2;
    }
    .for-switch {
      display: inline-block;
      margin-right: 0.25rem;
      margin-left: 1.25rem;
      font-size: 0.875rem;
    }
    @include media-breakpoint-down(md) {
      left: 0;
    }
  }

  .help-box {
    min-width: 1rem;
    cursor: pointer;
  }

  .form-contenttab {
    padding: {
      top: $grid-gutter-width / 2;
      bottom: $grid-gutter-width / 2;
    }
  }

  .form-group {
    .title {
      margin-bottom: 1.25rem;
    }
  }

  .hide {
    display: none;
  }

  .summary-description-container {
    overflow: hidden; // fixes horizontal scrolling on the product page

    .nav-tabs {
      overflow: hidden; // fixes tab borders bleeding into the tab content

      &.bordered {
        .nav-link {
          &.active {
            border-right: 1px solid $gray-light;
            border-left: 1px solid $gray-light;
          }
        }
      }
    }

    .tab-content {
      &.bordered {
        border: 1px solid $gray-light;
      }
    }
  }

  .product-feature {
    align-items: flex-end;
    margin-bottom: 1rem;
  }

  // Combination details form
  #accordion_combinations td.img img {
    max-width: 50px;
  }
  #accordion_combinations .combination td.img .fake-img {
    width: 50px;
    height: 50px;
    background: $gray-medium;
  }
  .product-combination-image {
    display: inline-block;
    margin: 0 0.625rem 0 0;
    border: 1px solid $gray-light;
    @include border-radius(0.1875rem);
    outline: solid 4px #fff;
  }

  .product-combination-image.img-highlight {
    border: solid 2px $primary;
  }
  .product-combination-image input {
    display: none;
  }

  .combination-form {
    .nav {
      justify-content: space-between;
    }
    .combination-label {
      color: $gray-medium;
      &.vcenter {
        line-height: 5.625rem;
      }
    }
    .title {
      margin-bottom: 0.625rem;
      clear: both;
      font-size: 0.9375rem;
    }
    .next,
    .prev {
      display: inline-block;
      margin-bottom: 0.625rem;
      cursor: pointer;
    }
    .next {
      margin-left: auto;
    }
    .panel {
      background: #fff;
    }
  }

  // Dropzone & Image manager
  #product-images-dropzone {
    z-index: 1;
    padding: 5px;
    margin-bottom: 0;
    overflow-y: hidden;
    border: none;
    @include border-bottom-radius(0);
    @include transition(width 0.5s ease-out, margin 0.5s ease-out);

    &.col-md-8 {
      min-height: 200px;
      border-right: solid 1px $gray-light;
    }
    &.dropzone {
      .dz-preview {
        width: 130px;
        height: 130px;
        border: 1px solid $gray-light;
        &.active,
        &:hover {
          border: 3px solid $brand-primary;
          @include border-radius(3px);
        }
        &.openfilemanager {
          color: $gray-light;
          text-align: center;
          div {
            position: relative;
            top: 50%;
            display: inline-block;
            width: 50px;
            height: 50px;
            border: 5px solid $gray-light;
            @include border-radius(100%);
            transform: translateY(-50%);
            span {
              display: inline-block;
              height: 50px;
              font-size: 30px;
              font-weight: 600;
              line-height: 40px;
              text-align: center;
            }
          }
        }
        .dz-image {
          width: 100%;
          height: 100%;
          line-height: 130px;
          @include border-radius(0);
          &.bg {
            background-repeat: no-repeat;
            background-position: center center;
            background-size: cover;
          }
          img {
            position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            max-width: 130px;
            max-height: 130px;
            margin: auto;
            filter: none;
          }
          &:hover {
            cursor: pointer;
          }
        }
        .iscover {
          position: absolute;
          bottom: 0;
          z-index: 10;
          width: 100%;
          padding: 5px;
          font-size: 12px;
          color: #fff;
          text-align: center;
          background: $gray-medium;
        }
        &.dz-image-preview {
          .dz-remove {
            display: none;
          }
          .dz-error-mark {
            display: none;
          }
          .dz-error-message {
            display: none;
          }
          .dz-success-mark {
            display: none;
          }
          .dz-details {
            .dz-size {
              display: none;
            }
            .dz-filename {
              display: none;
            }
          }
        }
        &:hover .dz-image img {
          filter: none;
          transform: none;
        }
      }
      &.dz-clickable * {
        cursor: pointer;
      }
    }
    .dz-default.dz-message {
      height: 100%;
      padding: 2em 0;
      margin: 0;
      a {
        font-weight: 700;
      }
      i {
        font-size: 60px;
        color: $gray-light;
        filter: alpha(opacity=50);
        opacity: 0.5;
      }
      small {
        font-size: 12px;
        font-style: italic;
        color: $gray-medium;
      }
    }
  }

  .nav-tabs {
    .nav-item.has-error {
      .nav-link {
        color: #c45c67;
        border-top: 3px solid #c45c67;
      }
    }
  }

  #product-images-form-container {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 0;
    float: left;
    min-height: 200px;
    margin: 10px 0 5px 5px;
    cursor: default;
    .close {
      position: absolute;
      top: 0;
      right: 0.5em;
      z-index: 1;
    }
    .actions {
      padding-top: 15px;
    }
  }

  #product-images-container {
    position: relative;
    display: inline-block;
    width: 100%;
    border: solid 1px $gray-light;
    .dropzone-expander {
      display: none;
      padding: 5px 0;
      font-size: 12px;
      font-weight: 600;
      color: $gray-medium;
      cursor: pointer;
      border-top: solid 1px $gray-light;
      span {
        display: none;
      }
      &.expand span.expand {
        display: block;
      }
      &.compress span.compress {
        display: block;
      }
    }
  }

  .twitter-typeahead {
    .tt-menu {
      width: 100%;
      max-height: 19.5rem;
      padding: 0.3125rem 0;
      overflow: auto;
      background: #fff;
      border: 1px solid $gray-medium;
    }
    .tt-suggestion {
      padding: 0.3125rem 0.625rem;
      color: $gray-medium;
      cursor: pointer;
      &:hover {
        color: #fff;
        background-color: $primary-hover;
      }
    }
  }

  .pack-product {
    position: relative;
    border: 0.0625rem solid $gray-light;
    @include border-radius($border-radius);

    > .cover {
      width: 100%;
    }
    > .btn-danger {
      position: absolute;
      top: 0.0625rem;
      right: 0.0625rem;
      visibility: hidden;
      opacity: 0;
    }
    &:hover {
      border: 2px $brand-primary solid;
      > .btn-danger {
        visibility: visible;
        opacity: 1;
      }
    }
    h4,
    .ref {
      padding: 0.625rem;
    }
    h4 {
      margin: 0;
      font-weight: 400;
      line-height: 1.25rem;
      color: #000;
    }
    .ref {
      color: $gray-medium;
    }
    .delete {
      background: #fff;
      border: none;
      .material-icons {
        color: $gray-light;
      }
    }
  }

  #add-categories {
    margin-top: 2.5rem;
  }

  #categories-tree {
    clear: both;
  }

  .ui-widget {
    > .form-control-label {
      font-size: 0.625rem;
      font-weight: 600;
    }
    > .ui-autocomplete-input {
      /* stylelint-disable selector-no-vendor-prefix */
      &::-webkit-input-placeholder,
      &::-moz-placeholder,
      &:-ms-input-placeholder,
      &:-moz-placeholder {
        font-size: 0.75rem;
      }
      /* stylelint-enable selector-no-vendor-prefix */
    }
  }

  .category-tree-overflow {
    overflow: auto;
    white-space: nowrap;
    ul.category-tree {
      display: inline-block;
      min-width: 100%;
      padding-top: 0.625rem;
      .main-category {
        font-size: 0.625rem;
        font-weight: 600;
      }
      label {
        position: relative;
        width: 100%;
        max-width: 100%;
        padding-right: 1.5rem;
        margin-bottom: 0;
        .default-category {
          position: absolute;
          top: 5px;
          right: 3px;
        }
      }
      ul {
        padding-left: 0.75rem;
      }
    }
  }

  .categories-tree {
    padding: 0.625rem;
    border: $gray-light 1px solid;
    @include border-radius(0.1875rem);

    .categories-tree-actions {
      display: flex;
      align-items: center;
      font-size: 0.625rem;
      font-weight: 600;
      text-transform: uppercase;
      border-bottom: 0.063rem solid $gray-light;

      [data-action="expand"],
      [data-action="reduce"] {
        cursor: pointer;
      }
      > hr {
        margin-top: 0.625rem;
      }
      .form-control-label {
        padding-top: 0.3125rem;
      }
      .material-icons {
        font-size: 1.25rem;
        vertical-align: middle;
      }
      #categories-tree-expand {
        display: none;
      }
      #categories-tree-expand,
      #categories-tree-reduce {
        cursor: pointer;
      }
    }
  }

  .subtitle {
    color: $gray-medium;
  }

  .external-link {
    font-weight: 600;
    .material-icons {
      vertical-align: middle;
    }
  }

  .btn-action {
    text-transform: none;
    &.focus,
    &:focus {
      color: $brand-primary;
    }
  }

  .customFieldCollection .delete {
    color: $gray-medium;
    .material-icons {
      font-size: 1.25rem;
    }
  }

  .maxLength {
    float: right;
    font-size: 12px;
    font-style: italic;
    color: $gray-medium;
  }

  textarea.autoload_rte + .maxLength {
    margin-top: 15px;
  }

  #form_step5_meta_description_1 {
    height: 8.75rem;
    resize: none;
  }

  #product-attachment-file {
    margin: 0;

    tbody {
      max-height: 450px;
      overflow-y: auto;
    }

    .checkbox {
      margin: 0;
      > label {
        margin: 0;
      }
    }

    td.file-name {
      overflow-x: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }

  #combinations-bulk-form {
    @include transition(opacity 1s ease-in-out);
    &.inactive {
      cursor: progress;
      opacity: 0.3;
      > * {
        pointer-events: none;
      }
    }
  }

  .combinations-list {
    th {
      font-size: $font-size-xs;
    }
    .combination {
      &.loaded {
        display: none;
      }
      &.timeline-wrapper,
      .timeline-item {
        background-color: transparent;
        @include border-radius(0);
      }
      .animated-background {
        height: 3.125rem;
      }
      .img {
        width: 8%;
      }
      .attribute-price,
      .attribute-quantity {
        width: 15%;
      }
      .attribute-finalprice {
        width: 10%;
        font-size: 0.8125rem;
      }
      .attribute-actions {
        line-height: $font-size-base;
        text-align: right;
        .btn-sm {
          padding: 0;
          &:hover {
            background-color: transparent;
            border-color: transparent;
          }
        }
      }
    }
  }

  .form-control-static {
    display: inline-block;
    margin-top: 1.563rem;
  }

  /* Last tab modules selection */
  #hooks.form-contenttab {
    .top-logo {
      float: left;
      max-width: 45px;
      max-height: 45px;
      margin: {
        right: 20px;
        bottom: 20px;
      }
    }

    .text-ellipsis.module-version,
    .module-version-author-grid {
      font-weight: 400;
      color: $gray-light;
    }
    .text-ellipsis.module-version {
      margin: {
        top: -10px;
        bottom: 10px;
      }
    }

    .module-item-wrapper-grid {
      box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.25);
    }

    .module-render-container {
      margin-bottom: $grid-gutter-width;

      > .name {
        margin-bottom: $grid-gutter-width / 2;
      }
    }
  }

  #custom_fields {
    .required-custom-field {
      padding: 0.375rem 1rem;
    }
  }

  #form_step6_tags .token-input {
    min-width: 768px;
  }

  #form_step3_tags .token-input {
    min-width: 768px;
  }
}

.page-sidebar-closed:not(.mobile) {
  .product-page {
    .product-footer {
      left: $size-navbar-width-mini;
    }
  }
}

.popover-title {
  display: none;
}

.ui-autocomplete {
  @media screen and (max-width: 1450px) {
    max-width: 12.31rem;
  }
  position: absolute;
  z-index: 1000;
  max-width: 18.13rem;
  padding: 0;
  margin-top: 2px;
  list-style: none;
  cursor: default;
  background-color: #fff;
  border: 1px solid #ccc;
  @include border-radius(5px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);

  > li {
    padding: 3px 20px;
    &:hover {
      cursor: pointer;
      background: $primary-hover;
      a {
        color: #fff;
        text-decoration: none;
      }
    }
    &.ui-state-focus {
      background-color: #ddd;
    }
  }
  a {
    color: $gray-medium;
  }
}

#attributes-list {
  .attribute-group {
    border: 0.0625rem solid $gray-light;
    border-bottom-width: 0;
    &:last-child {
      border-bottom-width: 0.0625rem;
    }
    .attribute-group-name {
      display: block;
      padding: 0.4375rem;
      font-weight: $font-weight-semibold;
      color: $gray-dark;
      &:hover {
        text-decoration: none;
      }
      &::after {
        float: right;
        font-family: "Material Icons", Arial, Helvetica, sans-serif;
        content: "\E316";
      }
      &.collapsed::after {
        content: "\E313";
      }
    }
    .attributes {
      height: 10.13rem;
      padding: 0.4375rem;
      overflow-x: hidden;
      border-top: 2px solid $gray-light;
      .two-columns {
        columns: 2;
      }
      .attribute {
        .js-attribute-checkbox {
          display: none;
          + .attribute-label {
            display: inline-block;
            margin: 0;
            font-size: $font-size-base;
            color: $gray-light;
            .pretty-checkbox {
              float: left;
              width: 1rem;
              height: 1rem;
              margin-right: 0.4375rem;
              content: "";
              border: 0.0625rem solid $gray-light;
              &.not-color::before {
                display: block;
                line-height: 1rem;
                color: #fff;
                text-align: center;
              }
            }
          }
          &:checked {
            + .attribute-label {
              font-weight: $font-weight-semibold;
              color: $gray-medium;
              .pretty-checkbox {
                &.not-color::before {
                  font-family: "Material Icons", Arial, Helvetica, sans-serif;
                  content: "\E5CA";
                  background: $primary;
                }
              }
            }
          }
        }
      }
    }
  }
}

.table {
  th {
    padding: {
      top: 0.625rem;
      bottom: 0.625rem;
    }
  }
  td {
    vertical-align: middle;
  }
}

#product_reference_field {
  margin-top: 7px;
}

#related-product,
#id-product-redirected {
  // list of added related products
  .typeahead-list {
    li {
      @extend .p-1;
      @extend .mt-1;
      @extend .d-flex;
      @extend .align-items-center;
      border: 1px solid $gray-light;

      // thumbnail
      > .media-left {
        img {
          max-width: 50px;
          max-height: 50px;
        }
      }

      // text
      > .media-body {
        .label {
          @extend .mx-1;
        }

        // delete button
        i.delete {
          float: right;
          color: $medium-gray;
          cursor: pointer;
        }
      }
    }
  }
}

@media only screen and (min-width: 320px) and (max-width: 1450px) {
  .product-page {
    .product-header {
      .edit {
        background-size: 3%;
      }
      .big-input {
        width: 100%;
        margin-bottom: 0.9375rem;
        input[type="text"] {
          height: 3.125rem;
        }
      }
      .form_step1_type_product {
        width: 20%;
      }
      .form_switch_language {
        width: 20%;
      }
      .toolbar {
        width: 60%;
      }
    }
    .tabs {
      width: auto;
      overflow: hidden;
      .material-icons {
        display: inline-block;
      }
      .arrow {
        position: absolute;
        top: 0;
        left: 15px;
        z-index: 2;
        height: 3rem;
        padding: 0.9375rem 0.3125rem;
        color: #fff;
        cursor: pointer;
        background: #fff;
        background: $brand-primary;

        &.visible {
          visibility: visible;
        }
      }
      .right-arrow {
        right: 15px;
        left: auto;
      }
    }
    .nav-tabs {
      position: relative;
      left: 35px;
      width: 125rem;
      height: 3.125rem;
    }
    .right-column {
      width: 30%;
    }
    .left-column {
      width: 70%;
    }
    .ui-helper-hidden-accessible {
      display: inline-block;
      margin-bottom: 0.9375rem;
    }
    .combination-form {
      padding: 0 1.25rem;
    }
    #form-nav[style*="display:none"] {
      ~ .arrow {
        display: none;
      }
    }

    #accordion_combinations {
      .attribute-finalprice,
      .attribute-price {
        display: none;
      }
    }
    #combinations_thead {
      th:nth-child(4),
      th:nth-child(5) {
        display: none;
      }
    }
    #bulk-combinations-container {
      width: 95%;
      #delete-combinations {
        float: right;
      }
      div.row:first-child .form-control-label {
        min-height: auto;
      }
      .btn-block {
        float: right;
        width: auto;
      }
    }
    .checkbox label {
      max-width: 80%;
    }
    .product-footer {
      .hidden-xs,
      input.save {
        display: none;
      }
      button.save {
        background: $brand-primary;
      }
      .spinner {
        margin-top: -0.3125rem;
      }
      .dropdown {
        display: block;
        margin-top: 0.625rem;
        .dropdown-menu {
          top: -7.5rem;
        }
      }
    }
  }
}

@media (min-width: 1300px) and (max-width: 1750px) {
  #bulk-combinations-container {
    .custom-width {
      width: 33%;
    }
  }
}

#description_short {
  #form_step1_description_short_1_ifr {
    min-height: 80px;
  }
}

#description {
  #form_step1_description_1_ifr {
    min-height: 80px;
  }
}
